package homework.day02.controller;

import homework.day02.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Scanner;

@Component
public class UserController {
    @Autowired
    private UserService userService;
    public void start(){
        System.out.println("请输入对应操作的序号序号:   (☆▽☆)");
        System.out.println("1:注册    2.登录    3.修改信息    4.用户列表    5.删除用户");
        int num = Integer.parseInt(new Scanner(System.in).nextLine());
        switch (num){
            case 1:
                userService.registerUser();
                break;
            case 2:
                userService.loginUser();
                break;
            case 3:
                userService.updateUser();
                break;
            case 4:
                userService.listUser();
                break;
            case 5:
                userService.deleteUser();
                break;
            default:
                System.out.println("乖！咱不输入其它的数字（*＾-＾*）");

        }
    }
}
